package com.yxzx.ucenter.controller;

import com.yxzx.common.YxzxResult;
import com.yxzx.ucenter.service.UcenterMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 会员表 前端控制器
 * </p>
 * @author kongfuzi
 * @since 2020-08-15
 */
@Api(tags = "用户中心控制器")
@CrossOrigin
@Slf4j
@RestController
@RequestMapping("/ucenter/ucenter-member")
public class UcenterMemberController {

    @Autowired
    private UcenterMemberService memberService;

    @ApiOperation("今日注册人数")
    @GetMapping("countRegister/{day}")
    public YxzxResult countRegister(@ApiParam(name = "day",value = "统计日期",required = true)
                                    @PathVariable String day){
        Integer count = memberService.selectRegisterCount(day);
        return YxzxResult.ok().data("item",count);
    }
}

